# Contributor: zhuqin <zhuqin83@gmail.com>

pkgname=gmlive-svn
_realname=gmlive
pkgver=255
pkgrel=1
pkgdesc="A live video for linux, powered by mms, sopcast and nslive."
arch=(i686) #i686 only for non-free sopcast & nslive
license=('GPL')
depends=('libglademm>=2.4.0' 'gtkmm>=2.6.0' 'sopcast' 'mplayer')
makedepends=('subversion' 'pkgconfig>=0.9.0' 'autoconf' 'automake' 'intltool' 'gnome-common'
                  )
install=nslive.install
url="http://code.google.com/p/gmlive/"
source=(http://www.newseetv.com/soft/nslive-0.1.0.tar.gz
        #http://download.sopcast.cn/download/sp-auth.tgz
         )
conflicts=('gmlive')
md5sums=()

_svntrunk=http://$_realname.googlecode.com/svn/trunk/
_svnmod=gmlive

build() {
    cd $srcdir
    
    msg "Updating SVN entries for $_svnmod ..."
    
    if [ -d $_svnmod/.svn ]; then
      (cd $_svnmod && svn up -r $pkgver)
    else
      svn co $_svntrunk --config-dir ./ -r $pkgver $_svnmod
    fi
    
    cp -r $_svnmod $_svnmod-build
    
    cd $_svnmod-build
    
    msg "Finished update, starting build ..."

    #uncomment "--enable-plugin" if you need totem plugin support.
    ./autogen.sh --prefix=/usr #--enable-plugin
    make || return 1
    make DESTDIR=$pkgdir install

     # 增加nslive流支持
    cd $srcdir/nslive-0.1.0
    install -D -m755 gnslive nslive nsweb $pkgdir/usr/bin/
    #cd $srcdir/sp-auth
    #install -D -m755 sp-sc-auth $pkgdir/usr/bin/

    rm -rf $srcdir/$_svnmod-build
}
